<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['数据统计','垃圾站点数据']" icon="fa fa-area-chart" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>垃圾站点数据</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<div class="top_module top_module_box">
									<span class="module_text">车牌号码</span>
									<div class="s_hover_box">
										<select   class="select2"  id="carNumberSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='del_carNumber()'>x</div>
									</div>
								</div>
								<div class="selectDate top_module">
									<div class="input-daterange input-group s_selected_time_box s_hover_box">
										<input type="text" [(ngModel)]='startTime' class="form-control s_selected_time" id="datetimepicker3"  autocomplete="off" placeholder="选择开始时间"/>
										<span class="s_selected_time_spe">至</span>
										<input type="text" [(ngModel)]='endTime' class="form-control s_selected_time" id="datetimepicker4"  autocomplete="off" placeholder="选择结束时间"/>
										<div class="s_del_icon" (click)='del_date()'>x</div>
									</div>
								</div>
								<button type="button" class="btn btn-primary" (click)="search_data()">查询</button>
								<button type="button" class="btn btn-primary" (click)="export_totle()">导出</button>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>车牌号码</th>
										<th>时间</th>
										<th>清运重量(吨)</th>
										<th>站点名</th>
										<th>经纬度</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>{{row.carNumber}}</td>
										<td>{{row.uploadDate}}</td>
										<td>{{row.weight}}</td>
										<td>{{row.stationName}}</td>
										<td>
											<span *ngIf="row.x">{{row.x}},</span><span *ngIf="row.y">{{row.y}}</span>
										</td>
										<td>
											<button type="button" (click)="position(row)">定位</button>
											<button type="button" (click)="fix_position(row,positionModal)">修改</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>	
	
	<!--<div class="row">-->
		<!-- 站点列表 弹窗-->
		<section bsModal #positionModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-lg">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" (click)="cancelPosition(positionModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
						<h4 class="modal-title">站点列表</h4>
					</div>
					<div class="modal-body">
						<div class="row form-horizontal">
							<ul  class="stationNamelist">
								<li *ngFor='let item of stationNameList;let i=index' [ngClass]="{activeName: item.id === activeName}" (click)='selectStationName(item,positionModal)'>
							    	{{i+1}}、 {{item.name}}
								</li>
						     </ul> 
						</div>
					</div>
				</div>
			</div>
		</section>
		<!-- 站点列表 弹窗-->
	<!--</div>-->
  	<div class="row" [hidden]="!itemPosition" style="margin-top: 12px;">
		<div class="row warpDiv">
			<div class="col-xs-12 col-sm-8 col-lg-4 stationList " >
				<h1 class="carTitle">站点管理</h1>
				<div class="s_vision">
					<div class="dd-draghandle dd" *ngFor="let item of stationlist;let i = index">
						<div class="s_title">第{{i+1}}组 <span class="delGroup" (click)='deleteGroup(i)'>删除</span></div>
						<ul class="groupUl dd-list">
							<li class="item"  [ngClass]="{activeItem: itemChild.id === activeIndex}"  
								*ngFor="let itemChild of stationlist[i];let j = index" 
								(click)='findStation(itemChild.id)'>
								名称:<input type="text" [(ngModel)]="itemChild.name" class="stationName s_fix_bc word_nowrap" (click)='sotpEven($event)'/>
								区域名:<input type="" [(ngModel)]="itemChild.streetName" class="streetName s_fix_bc word_nowrap" (click)='isTableOpen("open")'/>
								户籍数:<input type=""  [(ngModel)]="itemChild.houseNumber" class="houseNumber s_fix_bc word_nowrap"/>
								<input type="" [(ngModel)]="itemChild.longitude" class="hideInp"/>
								<input type="" [(ngModel)]="itemChild.lantitude" class="hideInp"/>
								<span class="delItem"  (click)='deleteItem($event,itemChild.id)'>x</span>
							</li>
						</ul>
						<button class="btn btn-primary" style="padding:0;min-width: 72px;" (click)='addStation(i)'>+ 添加</button>
					</div>
				</div>
				<div class="s_footer">
					<button class="btn btn-info btn-xs btn-primary" style="padding: 4px 0;" (click)="addGroup()">新增一组</button>
					<button class="btn btn-info btn-xs postPoint btn-primary" style="padding: 4px 0;" (click)="submitStation()">保存站点</button>
				</div>
			</div>
			<div class="col-xs-12 col-sm-4 col-lg-8 map" style="position: relative;padding: 0;">
				<div class="mapSearchGroup s_map_btn">
					<div class=" seachDiv col-xs-md col-lg-3 " style="padding: 0;">
						<div id="r-result"  class="input-group">
							<input type="text" id="suggestId"  placeholder='请输入需要搜索的地址' class="col-xs-10 form-control" />
							<span class="input-group-btn">
								<button type="button" class="btn btn-primary btn-sm" id="search" style="margin-right: 0;">搜索</button>
							</span>
						</div>
						<div id="searchResultPanel" style="border:1px solid #C0C0C0;width:150px;height:auto; display:none;"></div>
					</div>
					<div class="col-md-12 col-lg-3 seachPotion" style="padding: 0;">
						<div class="input-group">
							<input type="text"  placeholder="请输入具体的经纬度" class="col-xs-10 form-control getCoordinate" autocomplete="off" [(ngModel)]="searchPointVal">
							<span class="input-group-btn">
								<button type="button" class="btn btn-primary btn-sm sureCoordinate"  (click)="searchPoint()" style="margin-right: 0;">定位</button>
							</span>
						</div>
					</div>
					<div class="form-group col-md-8 col-lg-4 seachTime" style="padding: 0;">
						<div class="input-daterange input-group">
							<input type="text" class="form-control" autocomplete="off" id="datetimepicker1" >
							<span class="input-group-addon" style="padding:0 9px;">至</span>
							<input type="text" class="form-control" autocomplete="off" id="datetimepicker2" >
						</div>
					</div>
					<button type="button" class="btn btn-primary btn-sm lookTrack col-md-3 col-lg-1" (click)="drawTrack()">轨迹</button>
				</div>
				<div id="baiduMap" style="height: 850px;" class="col-xs-12"></div>
				<sa-bmap-tools [baiduMap]="baiduMap" [isShowZoom]="true" [reduceHeight]="36" baiduMapHeight="60px"></sa-bmap-tools>
			</div>
		
			<div class='addStreetView' id="addStreetView" *ngIf="isAddStreet">
		    	<div class="overLay"></div>
				<div class="delPrompt row alertContent" >  
					<ul style="margin:0;">
						<li style="margin: 10% 0 10px 0;text-align: center;">{{addStreetTitle}}区域信息</li>
						<li class="row" style="margin-bottom: 10px;">
					    	<span class='col-sm-12 col-xs-12 col-md-2' style="text-align: center;">区域名</span>
							<input class="col-xs-12 col-md-8"  [(ngModel)]='addStreetName'/>  
						</li>
						<li  class="row" >
							<span class='col-sm-12 col-xs-12 col-md-2' style="text-align: center;">户籍数</span>
							<input class="col-xs-12 col-md-8"  type='number' [(ngModel)]='addHouseNumber'   min="1" />
							<span class="cancelStreet" (click)='isStreetAppend("close")'>
							<i class=" ace-icon fa fa-times"></i></span>  
						</li>
						<li class="row" style="margin-top: 10px;text-align: center;">	
						 	<button class="btn btn-minier addStreet" (click)='submitStreet()'>确定</button> 
						</li>
				     </ul>          
				</div>
			</div>
			
			<div class="listTabel" draggable="true"  *ngIf="isShowTable">
			<div class="clearfix s_table_btn">
				<div class="left top-search">
					<input type="text" [(ngModel)]="searchKey_street" (change)="table_search_street(searchKey_street)" class="search-input" placeholder="输入需要搜索的区域名...">
					<span class="top-search-box">
				        <button class="top-search-btn" type="button" (click)="table_search_street(searchKey_street)"> <i class="fa fa-search"></i></button>
				    </span>
				</div>
				<div class="right page-header-btn">
					<button  type="button"  class="btn btn-primary"  (click)='isStreetAppend("open")'>添加</button>
					<button  type="button"  class="btn btn-primary" (click)='isTableOpen("close")'> 关闭</button>
				</div>
			</div>
			<!--表格头部操作部分end-->
			<!--表格部分-->
			<div sa-widget [editbutton]="false" color="darken">
				<div>
					<div class="widget-body moveTable no-padding table-fix">
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>区域名称</th>
										<th>户籍数</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData_street" >
										<td>{{row.streetName}}</td>
										<td>{{row.houseNumber}}</td>
										<td>
											<button type="button" (click)="selectStreet(row)">选择</button>
											<button type="button" (click)="editStreet(row)">修改</button>
											<button type="button" (click)="removeStreet(row)">删除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount_street"
						           [rows]="fixPageSize_street"
						           [isPageSize]="false"
						           [currentPage]="curPage_street - 1"
						           (onPageChange)="setPage_street($event)">
							</paginator>
							<!--<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>-->
							<div class="fix-page-size" *ngIf="totalCount_street">
								<span>每页显示</span>
								<select class="page-selected" style="width: 70px;" (ngModelChange)="updatePageSize_street($event)" [(ngModel)]="fixPageSize_street">
									<option>10</option>
									<!--<option>20</option>
									<option>30</option>
									<option>50</option>-->
								</select>
								<span>条</span>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!--表格部分end-->
				
			</div>
		</div>	
	</div>
</div>
